﻿using mozhi.smarterp.Business.Common;
using mozhi.smarterp.Business.Enums;
using System;
using System.Collections.Generic;
using Volo.Abp.Application.Dtos;

namespace mozhi.smarterp.Business.Purchases.Order
{
    public class PurchaseOrderDto : DocumentHeaderDto
    {
        /// <summary>
        /// 供应商
        /// </summary>
        public Guid? SupplierId { get; set; }

        public string SupplierName { get; set; }

        /// <summary>
        ///要货日期
        /// </summary>
        public DateTime? RequiredDate { get; set; }

        /// <summary>
        /// 采购订单类型
        /// </summary>
        public PurchaseOrderType Type { get; set; }

        /// <summary>
        /// 采购员
        /// </summary>
        public Guid? PurchaserId { get; set; }

        public string PurchaserName { get; set; }

        public List<PurchaseOrderItemDto> Items { get; set; }

        public List<PurchaseOrderAdvancePaymentItemDto> AdvancePaymentItems { get; set; }
    }

    public class PurchaseOrderItemDto : DocumentBodyDto
    {
        /// <summary>
        /// 采购单位
        /// </summary>
        public Guid PurchaseUnitId { get; set; }

        public string PurchaseUnitName { get; set; }

        /// <summary>
        /// 采购数量
        /// </summary>
        public decimal PurchaseQuantity { get; set; }

        public bool IsGift { get; set; }
    }

    public class PurchaseOrderAdvancePaymentItemDto : EntityDto<Guid>
    {
        public decimal AdvancePaymentPercent { get; set; }

        public decimal AdvancePaymentAmountFr { get; set; }

        public decimal AdvancePaymentAmount { get; set; }

        public DateTime? DueDate { get; set; }

        public DateTime? ExpectedDate { get; set; }

        public Guid? AdvancePaymentId { get; set; }

        public string AdvancePaymentNumber { get; set; }

        public decimal? PaymentAmountFr { get; set; }

        public int Index { get; set; }
    }
}
